package com.vcredit.creditcat.web.api;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.vcredit.creditcat.api.IAppCacheClearManager;
import com.vcredit.creditcat.api.IMyWalletManager;
import com.vcredit.creditcat.dto.wallet.WalletDrawHandlerResultDto;
import com.vcredit.creditcat.dto.wallet.WalletDrawLogDto;
import com.vcredit.framework.util.HttpRequest;
import com.vcredit.framework.util.JacksonUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.support.HttpRequestHandlerServlet;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * APP内部缓存主动清理类(适用于产品发布后的缓存清理)
 *
 * @time 2017-10-19
 * @author wichell
 */

@Controller
@RequestMapping("cache")
public class ClearCacheController {
	
	@Reference(version = "1.0")
	private IAppCacheClearManager appCacheClearManager;

	@RequestMapping(value = "clear",method = RequestMethod.GET)
	@ResponseBody
	public String query(HttpServletRequest request) {
		String cacheType = request.getQueryString();
		appCacheClearManager.clearCache(cacheType);
		return "success";
	}
}
